import React, { Component } from 'react';
class Inp extends Component {
  constructor(props) {
    super(props);
  }
  state = { val:''  }
  render() { 
    return ( <div style={{position:'relative'}}>
      <textarea maxLength={this.props.maxLen} value={this.state.val} onChange={e=>this.setState({val:e.target.value})}>
      </textarea>
      <div>{this.state.val.length}/{this.props.maxLen}</div>
    </div> );
  }
}
 
export default Inp;